<?php

namespace Drupal\shushengyuan\Schemas;

/**
 * @OA\Schema(
 *   schema="CategoryItem",
 *   type="object",
 *   description="CategoryItem"
 * )
 */
class CategoryItem extends AbstractBaseModel {

  protected function getEntityType() {
    return FALSE;
  }

  protected function setValue() {
    [$id, $name] = $this->context;
    $value = [
      /**
       * @OA\Property(
       *   property="id",
       *   type="integer",
       *   description="ID",
       * ),
       */
      'id' => (int) $id,
      /**
       * @OA\Property(
       *   property="name",
       *   type="string",
       *   description="分类名",
       * ),
       */
      'name' => (string) $name,
    ];
    $this->merge($value);
  }
}
